<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="portalForAppTemplate"/>
    <title>免费评房</title>
</head>

<body>
<nav class="nav">
    <a href="/portalForApp/create2Step3?id=${this.house?.id}&projectName=${this.house?.projectName}&city=${this.house?.city?.id}&district=${this.house.district}&contactId=${this.contactId}"><</a>
    极速询值结果
</nav>
<header class="create-header">
    <ul class="creat-flowList flex-box">
        <li data-id="01" class="flex1 active">
            <span></span>

            <h3>小区信息</h3>
        </li>
        <li data-id="02" class="flex1 active">
            <span></span>

            <h3>房产信息</h3>
        </li>
        <li data-id="03" class="flex1 active">
            <span></span>

            <h3>极速询值</h3>
        </li>
    </ul>
</header>

<form resource="${this.collateral}">

    %{--正常出值--}%
    <g:if test="${this.house?.status == 'Completed'}">
        <div class="bgcWhite asset-valuation">
            <div class="valuation-info">
                %{-- <h3>
                    <span>房产评估单价：</span>
                    <span class="colorRed">${String.valueOf(this.house?.unitPrice).substring(0, String.valueOf(this.house?.unitPrice).lastIndexOf("."))}</span>
                    <span>元&nbsp;/&nbsp;m<sup>2</sup></span>
                </h3>
                <h3>
                    <span>房产评估总价：</span>
                    <span class="colorRed">${String.valueOf(this.house?.totalPrice).substring(0, String.valueOf(this.house?.totalPrice).lastIndexOf("."))}</span>
                    <span>元</span>
                </h3> --}%
                <h3>
                    <span>房产评估单价：</span>
                    <span class="colorRed">${Math.round(this.house?.unitPrice)}</span>
                    <span>元&nbsp;/&nbsp;m<sup>2</sup></span>
                </h3>
                <h3>
                    <span>房产评估总价：</span>
                    <span class="colorRed"><g:formatNumber number="${Math.round(this.house?.totalPrice)}" minFractionDigits="2" maxFractionDigits="2" format="###,###.##"/></span>
                    <span>元</span>
                </h3>

                <g:if test="${this.house?.atticArea > 0}">
                    <g:if test="${this.house?.specialFactors == '跃层'}">
                        <h3>
                            <span>总价含跃层总价：</span>
                            <span class="colorRed">${Math.round(this.house?.unitPrice * this.house?.atticArea / 2)}</span>
                            <span>元</span>
                        </h3>
                    </g:if>
                    <g:if test="${this.house?.specialFactors == '顶楼带阁楼'}">
                        <h3>
                            <span>总价含阁楼总价：</span>
                            <span class="colorRed">${Math.round(this.house?.unitPrice * this.house?.atticArea / 2)}</span>
                            <span>元</span>
                        </h3>
                    </g:if>
                </g:if>
            </div>

            <h3 style="text-align: center">
                <g:link action="suggest" id="${this.house?.id}"  params="[backUrl:'https://quickloan.cindata.cn/portalForApp/create2Step4/'+this.house?.id+'?contactId='+this.contactId]">询值结果不满意？立即反馈</g:link>
            </h3>
            <div class="bigBtn" style="margin-bottom: 6px">
                <g:link action="show2" class="linkBtn weui_btn weui_btn_primary"
                        id="${this.house?.opportunity?.id}" params="[contact:this.contactId,collateralId:this.house?.id]">立即报单</g:link>

                %{--<g:link controller="portalForApp" action="login" class="linkBtn2 weui_btn weui_btn_primarys" disabled="disabled">--}%
                    %{--<div class="card-sup first sup-radius">--}%
                        %{--<i class="icon icon-1"></i> 返回首页--}%
                        %{--<i class="curve border-curve"></i>--}%
                    %{--</div>--}%
                %{--</g:link>--}%
                <a href="/portalForApp/login?externalId=${this.house?.opportunity?.contact?.externalId}&fullName=${this.house?.opportunity?.contact?.fullName}&cellphone=${this.house?.opportunity?.contact?.cellphone}" class="linkBtn2 weui_btn weui_btn_primarys" disabled="disabled">
                    <div class="card-sup first sup-radius">
                        <i class="icon icon-1"></i> 返回首页
                        <i class="curve border-curve"></i>
                    </div>
                </a>
            </div>
        </div>
    </g:if>
${this.contact?.id}
    %{-- 出异常值 --}%
    <g:if test="${this.house?.status == 'Pending'}">
        <div class="bgcWhite asset-valuation">
            <div class="valuation-info">
                <h3>
                    <span style="color:blue">参考</span><span>评估单价：</span>
                    <span style="color:blue">${Math.round(this.house?.unitPrice)}</span>
                    <span>元&nbsp;/&nbsp;m<sup>2</sup></span>
                </h3>

                <h3>
                    <span style="color:blue">参考</span><span>评估总价：</span>
                    <span style="color:blue"><g:formatNumber number="${Math.round(this.house?.totalPrice)}" minFractionDigits="2" maxFractionDigits="2" format="###,###.##"/></span>
                    <span>元</span>
                </h3>
                <g:if test="${this.house?.atticArea > 0}">
                    <g:if test="${this.house?.specialFactors == '跃层'}">
                        <h3>
                            <span>总价含跃层总价：</span>
                            <span style="color:blue">${Math.round(this.house?.unitPrice * this.house?.atticArea / 2)}</span>
                            <span>元</span>
                        </h3>
                    </g:if>
                    <g:if test="${this.house?.specialFactors == '顶楼带阁楼'}">
                        <h3>
                            <span style="color:blue">参考</span><span>总价含阁楼总价：</span>
                            <span style="color:blue">${Math.round(this.house?.unitPrice * this.house?.atticArea / 2)}</span>
                            <span>元</span>
                        </h3>
                    </g:if>
                </g:if>
            </div>

            <h4 style="color:blue">以上价格为参考价格，需人工核实，</h4>
            <h4>我们正在火速处理，请您稍后</h4>
            <h4>登录微信查看</h4>
        </div>
    </g:if>

    %{-- 无法出值 --}%
    <g:if test="${this.house?.status == 'Failed'}">
        <div class="bgcWhite asset-valuation">
            <div class="valuation-info">
                <h3>
                    <span>房产评估单价：</span>
                    <span class="colorRed">待确定</span>
                    <span>元&nbsp;/&nbsp;m<sup>2</sup></span>
                </h3>

                <h3>
                    <span>房产评估总价：</span>
                    <span class="colorRed">待确定</span>
                    <span>元</span>
                </h3>
            </div>

            <h4 class="colorRed">房产评估总价需人工核实，</h4>
            <h4>我们正在火速处理，请您稍后</h4>
            <h4>登录微信查看</h4>
        </div>
    </g:if>
</form>

<script>
    $(function () {
        $(".linkBtn").click(function () {
            $(this).addClass("active");

        });
        $(".linkBtn2").click(function () {
            $(this).addClass("active");
        });
        //报单的好处
        $("#benefit-btn").click(function (event) {
            $("#reportBill-benefit").toggleClass("hide")
            event.stopPropagation();
        });
        $(document).click(function () {
            if (!$("#reportBill-benefit").hasClass("hide")) {
                $("#reportBill-benefit").addClass("hide");
            }
        });
        //阻止冒泡
        $("#reportBill-benefit").click(function (event) {
            if (!$("#reportBill-benefit").hasClass("hide")) {
                event.stopPropagation();
            }
        });
    });


</script>
</body>
</html>
